package org.elsfs.framework.event.support.event;

import org.elsfs.framework.event.Subscribe;

/**
 * @author zeng
 * @since 0.0.1
 */
public class SubclassTestSubscriber extends TestSubscriber {

  public int bazCount;

  public SubclassTestSubscriber() {
    bazCount = 0;
  }

  @Subscribe
  public void onEvent(BazEvent event) {
    bazCount++;
    lastEvent = event;
  }

  @Subscribe
  public void onEvent(ErrorCausingEvent event) {
    throw new UnsupportedOperationException("This throws!");
  }

  @Override
  public int getCount() {
    return super.getCount() + bazCount;
  }
}
